home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 119
/
MOBICLIC 119.ISO
/
pc
/
DATA
/
DCV119
/
DCV119_00
/
DCV119_00.swf
/
scripts
/
frame_10
/
DoAction.as
Wrap
Text File
|
2009-11-16
|
16KB
|
610 lines
function randRange(min, max)
{
var _loc1_ = Math.floor(Math.random() * (max - min + 1)) + min;
return _loc1_;
}
cacheEtlissage([]);
this.createEmptyMovieClip("b1",1000);
b1.loadMovie(swfStocker.BUG_TRONC._url,1);
b1.forceSmoothing = true;
b1._x = -500;
b1._y = -400;
b1.forceSmoothing = true;
this.createEmptyMovieClip("w1",1001);
XmlLM = moduleInfo.returnNodeByPath("Module." + gLangue + ".LegendesMedias");
var L_nodes = XmlLM.childNodes;
var NbLM = L_nodes.length;
var L_LM_animaux = new Array();
var i = 1;
while(i < NbLM)
{
L_LM_animaux.push(String(L_nodes[i].firstChild));
i++;
}
trace("L_LM_animaux = " + L_LM_animaux);
var nbEcrans = L_LM_animaux.length;
trace("nbEcrans = " + nbEcrans);
var options = moduleInfo.returnNodeByPath("Module.Config.paramsDiaporama").attributes;
var dureeDiapo = Number(options.dureeDiapo) * 1000;
var tempoAide = Number(options.tempoAide) * 1000;
var NoZoneSelected = 0;
var NewCatched = -1;
var LocalLastCatched = 0;
var L_ordreFotos = [];
var Hitscount = 0;
var HelpNo = -1;
var aide = -1;
if(_global.flagRetourMiniQuiz == undefined)
{
_global.flagRetourMiniQuiz = false;
}
switch(_global.flagRetourMiniQuiz)
{
case true:
var flagSpecialDiapo = true;
var L_result = [[1,1,1,1,1],[1,1,1,1,1],[1,1,1,1,1]];
_global.flagRetourMiniQuiz = false;
break;
case false:
var flagSpecialDiapo = false;
var L_result = [[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]];
}
Hitscounting = function()
{
return sommeListe(L_result[0]) + sommeListe(L_result[1]) + sommeListe(L_result[2]);
};
hideFotoButtons = function()
{
trace("masquage des boutons photo");
var _loc2_ = 0;
while(_loc2_ < 5)
{
var _loc3_ = "BT_PHOTO_" + gimme2digits(NoZoneSelected) + "_" + gimme2digits(_loc2_ + 1);
_root[_loc3_]._visible = false;
_loc2_ = _loc2_ + 1;
}
};
_root.hideFotoButtons = hideFotoButtons;
hideMedaillons = function()
{
trace("masquage des médaillons");
var _loc2_ = 0;
while(_loc2_ < 5)
{
var _loc3_ = "MEDA_" + gimme2digits(NoZoneSelected) + "_" + gimme2digits(_loc2_ + 1);
_root[_loc3_]._visible = false;
_loc2_ = _loc2_ + 1;
}
};
_root.hideMedaillons = hideMedaillons;
showMedaillons = function()
{
trace("masquage des médaillons");
var _loc2_ = 0;
while(_loc2_ < 5)
{
var _loc3_ = "MEDA_" + gimme2digits(NoZoneSelected) + "_" + gimme2digits(_loc2_ + 1);
_root[_loc3_]._visible = true;
_loc2_ = _loc2_ + 1;
}
};
_root.hideMedaillons = hideMedaillons;
helpselection = function()
{
var _loc4_ = L_result[NoZoneSelected - 1].length;
var _loc3_ = [];
if(_loc4_ > 0)
{
var _loc2_ = 0;
while(_loc2_ < _loc4_)
{
if(L_result[NoZoneSelected - 1][_loc2_] == 0)
{
_loc3_.push(_loc2_);
}
_loc2_ = _loc2_ + 1;
}
trace("liste des indexs d\'animaux non trouvés = " + _loc3_);
var _loc5_ = randRange(0,_loc3_.length - 1);
HelpNo = _loc3_[_loc5_];
trace("index de l\'aide dans cette liste d\'index = " + _loc5_);
trace("index de l\'aide = " + HelpNo);
_root.gotoAndStop("AIDE" + gimme2digits(NoZoneSelected));
clearInterval(aide);
}
};
gereEnvironnement = function(NoEnvironnement)
{
stop();
NoZoneSelected = NoEnvironnement;
var _loc4_ = 0;
while(_loc4_ < 5)
{
var _loc8_ = "MEDA_" + gimme2digits(NoZoneSelected) + "_" + gimme2digits(_loc4_ + 1);
var _loc5_ = "ZONE_" + gimme2digits(NoZoneSelected) + "_" + gimme2digits(_loc4_ + 1);
var _loc6_ = "BT_PHOTO_" + gimme2digits(NoZoneSelected) + "_" + gimme2digits(_loc4_ + 1);
if(L_result[NoZoneSelected - 1][_loc4_] == 1)
{
_root[_loc5_]._visible = false;
_root[_loc8_].gotoAndPlay("E2");
_root[_loc6_]._visible = true;
if(NewCatched == _loc4_ + 1)
{
if(sommeListe(L_result[NoZoneSelected - 1]) == 5)
{
bruit({nomBruit:"GAGNE"});
_root.gotoAndStop("TalkG_" + gimme2digits(NoZoneSelected));
}
}
}
else
{
_root[_loc5_]._visible = true;
_root[_loc6_]._visible = false;
}
_loc4_ = _loc4_ + 1;
}
_loc4_ = 0;
while(_loc4_ < 5)
{
_loc5_ = "ZONE_" + gimme2digits(NoZoneSelected) + "_" + gimme2digits(_loc4_ + 1);
_root[_loc5_].onRollOver = function()
{
pNo = extractNo({chaine:this._name});
this.useHandCursor = false;
trace(pNo);
};
_root[_loc5_].onPress = function()
{
pNo = extractNo({chaine:this._name});
L_result[NoZoneSelected - 1][pNo - 1] = 1;
L_result[NoZoneSelected - 1][pNo - 1] = 1;
trace("L_result = " + L_result);
Hitscount = Hitscounting();
trace("Nbécrans vus =" + Hitscount);
this._visible = false;
var _loc3_ = gimme2digits(NoZoneSelected) + "_" + gimme2digits(pNo);
NewCatched = pNo;
clearInterval(aide);
_root.gotoAndStop(_loc3_);
};
_root[_loc5_].onRollOut = function()
{
this.gotoAndStop("E1");
gereCursor(1);
};
_loc4_ = _loc4_ + 1;
}
_loc4_ = 0;
while(_loc4_ < 5)
{
var _loc3_ = "BT_PHOTO_" + gimme2digits(NoZoneSelected) + "_" + gimme2digits(_loc4_ + 1);
_root[_loc3_].onRollOver = function()
{
pNo = extractNo({chaine:this._name});
this.useHandCursor = true;
this.gotoAndPlay("E2");
bruit({nomBruit:"PHOTO"});
if(pNo == LocalLastCatched)
{
var _loc2_ = "_ALBUM";
}
else
{
_loc2_ = "_PHOTO";
}
bulle({refclip:this,suffixe:_loc2_});
trace(pNo);
};
_root[_loc3_].onPress = function()
{
pNo = extractNo({chaine:this._name});
NoPhoto2Show = pNo;
killbruit({nomBruit:"PHOTO"});
killbulle();
hideFotoButtons();
hideMedaillons();
clearInterval(aide);
if(pNo == LocalLastCatched)
{
this._x += 130;
this._y += 50;
this._xscale = 100;
this._yscale = 100;
}
var _loc3_ = gimme2digits(NoZoneSelected) + "_DIAPO";
_root.gotoAndStop(_loc3_);
};
_root[_loc3_].onRollOut = function()
{
this.gotoAndStop("E1");
killbruit({nomBruit:"PHOTO"});
killbulle();
};
_loc4_ = _loc4_ + 1;
}
MISSED_CLIC.onRollOver = function()
{
this.useHandCursor = false;
};
MISSED_CLIC.onPress = function()
{
bruit({nomBruit:"NO"});
};
BT_RETOUR.onRollOver = function()
{
this.useHandCursor = true;
this.gotoAndStop("E2");
bruit({nomBruit:"FERMER"});
};
BT_RETOUR.onPress = function()
{
this.gotoAndStop("E1");
killbruit({nomBruit:"FERMER"});
clearInterval(aide);
if(sommeListe(L_result[NoZoneSelected - 1]) == 5)
{
LocalLastCatched = 0;
NoZoneSelected = 0;
_root.gotoAndStop("ATTENTE");
}
else
{
_root.gotoAndStop("TalkB_" + gimme2digits(NoZoneSelected));
}
};
BT_RETOUR.onRollOut = function()
{
this.gotoAndStop("E1");
killbruit({nomBruit:"FERMER"});
};
};
commentEnvirComplet = function()
{
stop();
trace("Good------->");
if(Hitscount == 15)
{
var _loc1_ = "S2";
}
else
{
_loc1_ = "S1";
showmascotte({id:"b1",xMc:498,yMc:418,coef:100,attitude:"P"});
}
gNextLabel = "FIN_TalkG_" + gimme2digits(NoZoneSelected);
joueSon({nomSon:_loc1_});
};
fincommentEnvirComplet = function()
{
if(Hitscount == 15)
{
var _loc2_ = "BT_PHOTO_" + gimme2digits(NoZoneSelected) + "_" + gimme2digits(NewCatched);
LocalLastCatched = NewCatched;
trace("LocalLastCatched = " + LocalLastCatched);
NewCatched = -1;
_root[_loc2_]._x -= 130;
_root[_loc2_]._y -= 50;
_root[_loc2_]._xscale = 300;
_root[_loc2_]._yscale = 300;
flagSpecialDiapo = true;
}
else
{
NewCatched = -1;
}
hidemascotte({id:"b1"});
_root.gotoAndStop(gNextLabel = gimme2digits(NoZoneSelected) + "_ATTENTE");
};
commentEnvirIncomplet = function()
{
stop();
trace("Bad-------> ");
var _loc1_ = "P";
gNextLabel = "FIN_TalkB_" + gimme2digits(NoZoneSelected);
joueSon({nomSon:_loc1_});
showmascotte({id:"b1",xMc:498,yMc:418,coef:100,attitude:"P"});
};
fincommentEnvirIncomplet = function()
{
hidemascotte({id:"b1"});
_root.gotoAndStop("ATTENTE");
};
this.InitBT_QUIZ = function()
{
var bt_quiz = _root.BT_QUIZ;
_root.BT_QUIZ_FinCommentBug = function()
{
bt_quiz.BUG_QUIZ.gotoAndPlay("OUT");
bt_quiz.OnRollOut();
};
InitMC({mc:bt_quiz});
bt_quiz.pDepth = bt_quiz.getDepth();
trace("bt_quiz.pDepth INIT " + bt_quiz.pDepth);
bt_quiz.swapDepths(15400);
bt_quiz.gotoAndStop("E_0");
bt_quiz.BUG_QUIZ.gotoAndStop(1);
bt_quiz.pressFrame = "";
bt_quiz.OnRollOver = function()
{
this.useHandCursor = true;
trace("ROLL");
this.gotoAndStop("E2");
this.BUG_QUIZ.gotoAndPlay("IN");
trace("this.pc " + this.pc);
if(this.pc >= 100)
{
_root.joueSon({nomSon:"A",actionFin:"BT_QUIZ_FinCommentBug",zapBlock:"ZAP_NOBLOCK"});
}
else
{
this.Desactiver();
_root.joueSon({nomSon:"I",actionFin:"BT_QUIZ_FinCommentBug"});
}
};
bt_quiz.OnRollOut = function()
{
this.Activer();
this.gotoAndStop(this.FrameActuelle);
};
bt_quiz.RatioSet = function(pc)
{
trace("RATIOSET");
this.pc = pc;
this.FrameActuelle = "E_" + String(Math.floor(pc / 10) * 10);
this.gotoAndStop(this.FrameActuelle);
if(pc >= 100)
{
this.gotoAndStop("E1");
this.FrameActuelle = "E1";
this.onPress = function()
{
trace("CHANGEMODULE");
flagRetourMiniQuiz = 1;
ChangeModule({codeRub:"DCV",numMod:1});
};
}
};
var _loc3_ = 100 * Hitscounting() / nbEcrans;
trace("NEF " + _loc3_);
bt_quiz.RatioSet(_loc3_);
};
trace("SCRIPTS JLM");
extractNo = function(p)
{
var _loc3_ = p.chaine;
var _loc1_ = undefined;
var _loc0_ = null;
if((_loc0_ = _loc3_) === "")
{
return -999;
}
_loc1_ = _loc3_.length;
switch(_loc1_ < 2)
{
case true:
return -999;
case false:
return Number(tail({chaine:_loc3_,nbchars:2}));
default:
}
};
_global.extractNo = extractNo;
tail = function(p)
{
var _loc2_ = p.chaine;
var _loc3_ = p.nbchars;
var _loc4_ = undefined;
var _loc0_ = null;
if((_loc0_ = _loc2_) !== "")
{
switch(_loc3_ <= 0)
{
case true:
return "";
case false:
_loc4_ = _loc2_.length;
switch(_loc3_ > _loc4_)
{
case true:
return _loc2_;
case false:
return _loc2_.substr(_loc4_ - _loc3_,_loc4_ - 1);
}
}
_global.tail = tail;
}
return "";
};
but_tail = function(p)
{
var _loc2_ = p.chaine;
var _loc3_ = p.nbchars;
var _loc1_ = _loc2_.length;
return _loc2_.substr(0,_loc1_ - Math.min(_loc3_,_loc1_));
};
_global.but_tail = but_tail;
head = function(p)
{
var _loc2_ = p.chaine;
var _loc1_ = p.nbchars;
return _loc2_.substr(0,_loc1_);
};
_global.head = head;
but_head = function(p)
{
var _loc2_ = p.chaine;
var _loc1_ = p.nbchars;
var _loc3_ = _loc2_.length;
return _loc2_.substr(_loc1_,_loc3_ - _loc1_);
};
_global.but_head = but_head;
familyname = function(p)
{
var _loc5_ = p.chaine;
var _loc6_ = _loc5_.length;
var _loc4_ = false;
var _loc3_ = "";
var _loc1_ = 0;
while(_loc1_ < _loc6_ && _loc4_ == false)
{
var _loc2_ = _loc5_.charAt(_loc1_);
if(isNaN(_loc2_) == true)
{
_loc3_ += _loc2_;
}
else
{
_loc4_ = true;
}
_loc1_ = _loc1_ + 1;
}
return _loc3_;
};
_global.familyname = familyname;
bruit = function(p)
{
var _loc1_ = p.nomBruit;
joueBruitage({nomSon:"B_" + _loc1_});
};
_global.bruit = bruit;
_global.killbruit = function(p)
{
var _loc1_ = p.nomBruit;
stopBruitage({nomSon:"B_" + _loc1_});
};
_global.killBruit = killBruit;
bulle = function(p)
{
var _loc2_ = p.refclip;
var _loc1_ = p.suffixe;
gereTextes.afficheIB({codeIB:"IB" + _loc1_,mc:_loc2_});
};
_global.bulle = bulle;
killbulle = function()
{
gereTextes.masqueIB();
};
_global.killbulle = killbulle;
_global.cacheEtlissage = function(L_SharedMc)
{
L_SharedMc = p.L_SharedMc;
var _loc3_ = L_SharedMc.length;
var _loc1_ = 0;
while(_loc1_ < _loc3_)
{
L_SharedMc[_loc1_].cacheAsBitmap = true;
L_SharedMc[_loc1_].forceSmoothing = true;
_loc1_ = _loc1_ + 1;
}
};
_global.cacheEtlissage = cacheEtlissage;
showmascotte = function(p)
{
id = p.id;
xMc = p.xMc;
yMc = p.yMc;
coef = p.coef;
attitude = p.attitude;
var _loc2_ = _root[id];
_loc2_._xscale = coef;
_loc2_._yscale = coef;
_loc2_._x = xMc - _loc2_._width / 2;
_loc2_._y = yMc - _loc2_._height / 2;
switch(attitude)
{
case "P":
_loc2_.gotoAndPlay("E1");
break;
case "M":
_loc2_.gotoAndPlay("E2");
}
};
_global.showmascotte = showmascotte;
hidemascotte = function(p)
{
id = p.id;
var _loc2_ = _root[id];
_loc2_._x = -500;
_loc2_._y = -500;
};
_global.hidemascotte = hidemascotte;
_global.listenulle = function(N)
{
var _loc2_ = new Array();
var _loc1_ = 0;
while(_loc1_ < N)
{
_loc2_.push(0);
_loc1_ = _loc1_ + 1;
}
return _loc2_;
};
_global.ADD2LISTterms = function(L, STUFF)
{
var _loc2_ = L.length;
trace(_loc2_);
var _loc3_ = new Array();
var _loc1_ = 0;
while(_loc1_ < _loc2_)
{
_loc3_.push(L[_loc1_] + STUFF);
_loc1_ = _loc1_ + 1;
}
return _loc3_;
};
_global.sommeListe = function(Liste)
{
var _loc2_ = 0;
var _loc3_ = Liste.length;
var _loc1_ = 0;
while(_loc1_ < _loc3_)
{
_loc2_ += Liste[_loc1_];
_loc1_ = _loc1_ + 1;
}
return _loc2_;
};
_global.isEqualLists = function(LISTE1, LISTE2)
{
var _loc3_ = LISTE1.length;
var _loc6_ = LISTE2.length;
switch(_loc3_ == _loc6_)
{
case true:
var _loc2_ = -1;
var _loc1_ = 0;
while(_loc1_ < _loc3_ and _loc2_ == -1)
{
if(LISTE1[_loc1_] !== LISTE2[_loc1_])
{
_loc2_ = _loc1_;
}
_loc1_ = _loc1_ + 1;
}
if((_loc0_ = _loc2_) !== -1)
{
var _loc7_ = false;
}
else
{
_loc7_ = true;
}
break;
case false:
_loc7_ = false;
}
return _loc7_;
};
if(flagSpecialDiapo)
{
_root.gotoAndStop("ATTENTE");
}
else
{
var nom_du_son = "00_01";
gNextLabel = "00_02";
joueSon({nomSon:nom_du_son});
}
stop();